build: keep tsdown.config.ts real TypeScript, fix the actual root cause instead - #8
Merged
Conversation
pnpm/npm only run a git dependency's own build (the "prepare" script) from inside a node_modules/ checkout -- exactly the one path Node's native TypeScript-stripping refuses to run against a .ts file. Committing dist/ removes the need for that build step entirely: a git-dependency install gets already-built output straight from the checkout, so the restriction never comes up, and tsdown.config.ts can stay a real TypeScript file for everyone working on this repo directly instead of being downgraded to plain JS to dodge it.
With dist/ now committed, the "prepare" script that ran a full build on every git-dependency install has nothing left to do -- remove it. tsdown.config.js reverts to tsdown.config.ts (nothing in the install path loads it anymore, so Node's node_modules TS-stripping restriction never applies to it), and every reference to the old plain-JS filename (turbo.json's _build inputs, eslint's ignore list, tsconfig.node.json's include) reverts to match. vendor/cddl/dist/ moves to .gitignore: dist/ already bundles its compiled output inline, so it's a build intermediate again, not something that needs tracking.
Rebuilds from source on every push and fails the check if dist/ doesn't match what's committed, so a change to src/ that isn't paired with a regenerated dist/ can't merge silently out of date.
Mearman
marked this pull request as ready for review
September 10, 2026 09:54
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Mearman
added a commit
to ExaDev/wire-mesh
that referenced
this pull request
Sep 10, 2026
The previous fix (a prepare script that builds cddl.js during install) still failed in CI: eslint's type-aware linting of generate.ts resolved parse/emitModule to an error type, not real type info, something never reproduced locally across four different attempts (hoisted and isolated pnpm linkers, a from-scratch store, a genuine Linux container matching CI's exact Node/pnpm versions). Fixed upstream properly instead of chasing the install-time build further: ExaDev/cddl.js#8 commits pre-built, attw-verified dist/ output and removes the prepare script entirely, so a git-dependency install ships already-correct code and type declarations with no build step, and therefore no install-time environment sensitivity, at all.
Mearman
added a commit
to ExaDev/wire-mesh
that referenced
this pull request
Sep 10, 2026
The previous fix (a prepare script that builds cddl.js during install) still failed in CI: eslint's type-aware linting of generate.ts resolved parse/emitModule to an error type, not real type info, something never reproduced locally across four different attempts (hoisted and isolated pnpm linkers, a from-scratch store, a genuine Linux container matching CI's exact Node/pnpm versions). Fixed upstream properly instead of chasing the install-time build further: ExaDev/cddl.js#8 commits pre-built, attw-verified dist/ output and removes the prepare script entirely, so a git-dependency install ships already-correct code and type declarations with no build step, and therefore no install-time environment sensitivity, at all.
Mearman
added a commit
to ExaDev/wire-mesh
that referenced
this pull request
Sep 10, 2026
The previous fix (a prepare script that builds cddl.js during install) still failed in CI: eslint's type-aware linting of generate.ts resolved parse/emitModule to an error type, not real type info, something never reproduced locally across four different attempts (hoisted and isolated pnpm linkers, a from-scratch store, a genuine Linux container matching CI's exact Node/pnpm versions). Fixed upstream properly instead of chasing the install-time build further: ExaDev/cddl.js#8 commits pre-built, attw-verified dist/ output and removes the prepare script entirely, so a git-dependency install ships already-correct code and type declarations with no build step, and therefore no install-time environment sensitivity, at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#7 worked around a real bug (a git-dependency install's own "prepare" script can't load tsdown.config.ts, because that install always resolves under node_modules and Node's native TS-stripping refuses to process a .ts file there) by demoting the config to plain JS. That fixes the symptom but not the cause: the actual problem is that a git-dependency install needs to build at all.
This fixes it at the source instead: dist/ is now committed, so a git-dependency install has nothing to build -- the prepare script (and the node_modules-TS-stripping restriction it was tripping) goes away entirely, and tsdown.config.ts stays real TypeScript for everyone working on the repo directly.
Verified against the actual failure mode: git archive'd this branch's HEAD into a nested node_modules/cddl.js/ path (exactly what a real git-dependency install produces), ran pnpm install there, confirmed no build runs (no "prepare" script exists), and imported all three entry points (dist/emitter.mjs, dist/parse.mjs, dist/runtime.mjs) directly to confirm they actually work.
CI now also rebuilds from source on every push and fails if dist/ doesn't match what's committed, so it can't silently drift.